Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Fix crash on OS X node tests #9553

Merged
merged 2 commits into from
Jul 21, 2017
Merged

Fix crash on OS X node tests #9553

merged 2 commits into from
Jul 21, 2017

Conversation

jfirebaugh
Copy link
Contributor

Fixes #8812.

@kkaefer kkaefer added the Node.js node-mapbox-gl-native label Jul 20, 2017
@jfirebaugh jfirebaugh requested a review from kkaefer July 21, 2017 15:30
@@ -19,7 +19,12 @@ var Map = function(options) {
return new constructor(Object.assign(options, {
request: function(req) {
request(req, function() {
req.respond.apply(req, arguments);
var args = arguments;
// Protect ourselves from `request` implementations that try to release Zalgo.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what Zalgo is without googling. Can we use a clearer phrasing of the issue here please?

Copy link
Contributor Author

@jfirebaugh jfirebaugh Jul 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, that was overly snarky. I've rephrased the comment, and kept the link for further background.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I saw the link, but even then it took me a while to understand that it refers to a meme. Thanks for updating!

var args = arguments;
// Protect ourselves from `request` implementations that try to release Zalgo.
// http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony
setImmediate(function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to use setImmediate instead of process.nextTick?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really. Sounds like process.nextTick is in fact more "immediate" than setImmediate. It probably doesn't matter though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Node.js node-mapbox-gl-native
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants